﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace AngelSpellMaker
{
    public partial class UniWaveTarget860 : Form
    {
        // Variables Globales de Voc
        string voc1;
        string voc2;
        string voc3;
        string voc4;

        public UniWaveTarget860()
        {
            InitializeComponent();
        }

        #region Menu Strip Branch
        private void clearFieldsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result;
            result = MessageBox.Show("Sure, you want to clean all the fields?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (TextBoxSpellName.Text != "" && TextBoxSpellWord.Text != "" && TextBoxSpellLvl.Text != "" && TextBoxMana.Text != "" && TextBoxRange.Text != "" && TextBoxScript.Text != "" && TextBoxMinA.Text != "" && TextBoxMinB.Text != "" && TextBoxMaxA.Text != "" && TextBoxMaxB.Text != "" && SelectEffectBox.SelectedIndex != -1 && SelectFormulaBox.SelectedIndex != -1 && comboBox1.SelectedIndex != -1 && comboBox2.SelectedIndex != -1)
            {
                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    SyntaxTextBox.Clear();
                    TextBoxXML.Clear();
                    TextBoxSpellName.Clear();
                    TextBoxSpellWord.Clear();
                    TextBoxSpellLvl.Clear();
                    TextBoxMana.Clear();
                    TextBoxRange.Clear();
                    TextBoxScript.Clear();
                    TextBoxMinA.Clear();
                    TextBoxMinB.Clear();
                    TextBoxMaxA.Clear();
                    TextBoxMaxB.Clear();
                    MessageBox.Show("Clear the fields have been correctly", "Action Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Operation has been canceled", "Action Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Clear the fields have been correctly", "Action Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
                SyntaxTextBox.Clear();
                TextBoxXML.Clear();
                TextBoxSpellName.Clear();
                TextBoxSpellWord.Clear();
                TextBoxSpellLvl.Clear();
                TextBoxMana.Clear();
                TextBoxRange.Clear();
                TextBoxScript.Clear();
                TextBoxMinA.Clear();
                TextBoxMinB.Clear();
                TextBoxMaxA.Clear();
                TextBoxMaxB.Clear();
            }
        }

        private void saveSpellToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String scriptspell = TextBoxScript.Text.ToString();
            SaveFileDialog saveFile1 = new SaveFileDialog();
            saveFile1.FileName = scriptspell;
            saveFile1.Filter = "Lua File|*.lua";
            if (saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
               saveFile1.FileName.Length > 0)
            {
                string ruta = saveFile1.FileName;
                StreamWriter fichero = new StreamWriter(ruta);
                fichero.Write(SyntaxTextBox.Text.ToString());
                fichero.Close();
            }
        }

        private void closeASMToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void formulaCalculatorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormulaCalculator formulaform = new FormulaCalculator();
            formulaform.Show();
        }

        private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("http://sourceforge.net/projects/angelspellmaker/");
        }

        private void contactToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutWin winabout = new AboutWin();
            winabout.Show();
        }

        #endregion

        private void MakeSpell_Button_Click(object sender, EventArgs e)
        {
            // Variables del XML Config
            #region Variables Config XML
            string spellname = TextBoxSpellName.Text;
            string spellword = TextBoxSpellWord.Text;
            string spelllvl = TextBoxSpellLvl.Text;
            string spellmana = TextBoxMana.Text;
            string spellrange = TextBoxRange.Text;
            string spellscript = TextBoxScript.Text;
            #endregion

            // Variables del Script del SPell
            #region Variables Config Script Spell
            string spelltype = comboBox2.Text.ToString();
            string spelleffect = SelectEffectBox.Text.ToString();
            string spellformula = SelectFormulaBox.Text.ToString();
            string spelldistance = comboBox1.Text.ToString();
            string minA = TextBoxMinA.Text;
            string minB = TextBoxMinB.Text;
            string maxA = TextBoxMaxA.Text;
            string maxB = TextBoxMaxB.Text;
            #endregion

            // Variables Main
            string linexml = "<instant name=\"" + spellname + "\" words=\"" + spellword + "\" lvl=\"" + spelllvl + "\" mana=\"" + spellmana + "\" prem=\"0\" range=\"" + spellrange + "\" casterTargetOrDirection=\"1\" blockwalls=\"1\" exhaustion=\"2000\" needlearn=\"0\" event=\"script\" value=\"" + spellscript + ".lua\">";
            string codespell = "-- Spell Creada en Angel Spell's Maker ---\n-- Borrar estas 3 Lineas, hace violacion a los derechos acordados en Creative Commons --\n-- Angel Spell's Maker creador por DJ Death --\nlocal combat = createCombatObject()\nsetCombatParam(combat, COMBAT_PARAM_TYPE, " + spelltype + ")\nsetCombatParam(combat, COMBAT_PARAM_EFFECT, " + spelleffect + ")\nsetCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, " + spelldistance + ")\nsetCombatFormula(combat, " + spellformula + ", -" + minA + ", -" + minB + ", -" + maxA + ", -" + maxB + ")\n\nlocal function cast(uno)\ndoCombat(cid, uno, var)\nend\n\nfunction onCastSpell(cid, var)\n\nreturn doCombat(cid, combat, var)\nend";

            // Function Main
            if (TextBoxSpellName.Text != "" && TextBoxSpellWord.Text != "" && TextBoxSpellLvl.Text != "" && TextBoxMana.Text != "" && TextBoxRange.Text != "" && TextBoxScript.Text != "" && TextBoxMinA.Text != "" && TextBoxMinB.Text != "" && TextBoxMaxA.Text != "" && TextBoxMaxB.Text != "" && SelectEffectBox.SelectedIndex != -1 && SelectFormulaBox.SelectedIndex != -1 && comboBox1.SelectedIndex != -1 && comboBox2.SelectedIndex != -1)
            {
                MessageBox.Show("Script has been created of Spell Correctly.\nGo to the Script tab.\n Angel Spell Maker Created by DJ Death.", "Action Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
                SyntaxTextBox.Clear();
                SyntaxTextBox.AppendText(codespell);
                TextBoxXML.AppendText(linexml + voc1 + voc2 + voc3 + voc4 + "</instant>");
            }
            else
            {
                MessageBox.Show("Complete text fields on the tab configuration", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }

        private void ButtonRunFC_Click(object sender, EventArgs e)
        {
            FormulaCalculator formula = new FormulaCalculator();
            formula.Show();
        }

        #region Select Boxes :f
        private void SelectEffectBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string a = SelectEffectBox.Text;
                switch (a)
                {
                    case "CONST_ME_DRAWBLOOD":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z0;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: DrawBlood");
                        break;

                    case "CONST_ME_LOSEENERGY":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z1;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Lose Energy");
                        break;

                    case "CONST_ME_POFF":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z2;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Poff");
                        break;

                    case "CONST_ME_BLOCKHIT":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z3;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Block Hit");
                        break;

                    case "CONST_ME_EXPLOSIONAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z4;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Explosion Area");
                        break;

                    case "CONST_ME_EXPLOSIONHIT":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z5;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Explosion Hit");
                        break;

                    case "CONST_ME_FIREAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z6;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Fire Area");
                        break;

                    case "CONST_ME_YELLOW_RINGS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z7;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Yellow Rings");
                        break;

                    case "CONST_ME_GREEN_RINGS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z8;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Green Rings");
                        break;

                    case "CONST_ME_HITAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z9;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Hit Area");
                        break;

                    case "CONST_ME_TELEPORT":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z10;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Teleport");
                        break;

                    case "CONST_ME_ENERGYHIT":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z11;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Energy Hit");
                        break;

                    case "CONST_ME_MAGIC_BLUE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z12;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Magic Blue");
                        break;

                    case "CONST_ME_MAGIC_RED":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z13;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Magic Red");
                        break;

                    case "CONST_ME_MAGIC_GREEN":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z14;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Magic Green");
                        break;

                    case "CONST_ME_HITBYFIRE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z15;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Fire Hit");
                        break;

                    case "CONST_ME_HITBYPOISON":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z16;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Poison Hit");
                        break;

                    case "CONST_ME_MORTAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z17;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Mort Area");
                        break;

                    case "CONST_ME_SOUND_GREEN":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z18;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sound Green");
                        break;

                    case "CONST_ME_SOUND_RED":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z19;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sound Red");
                        break;

                    case "CONST_ME_POISONAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z20;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Poison Area");
                        break;

                    case "CONST_ME_SOUND_YELLOW":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z21;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sound Yellow");
                        break;

                    case "CONST_ME_SOUND_PURPLE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z22;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sound Purple");
                        break;

                    case "CONST_ME_SOUND_BLUE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z23;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sound Blue");
                        break;

                    case "CONST_ME_SOUND_WHITE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z24;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sound White");
                        break;

                    case "CONST_ME_BUBBLES":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z25;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Bubbles");
                        break;

                    case "CONST_ME_CRAPS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z26;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Craps");
                        break;

                    case "CONST_ME_GIFT_WRAPS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z27;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Gift Wraps");
                        break;

                    case "CONST_ME_FIREWORK_YELLOW":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z28;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Firework Yellow");
                        break;
                    // configurar otros 10 D: para las 34
                    case "CONST_ME_FIREWORK_RED":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z29;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Firework Red");
                        break;

                    case "CONST_ME_FIREWORK_BLUE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z30;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Firework Blue");
                        break;

                    case "CONST_ME_STUN":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z31;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Stun");
                        break;

                    case "CONST_ME_SLEEP":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z32;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Sleep");
                        break;

                    case "CONST_ME_WATERCREATURE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z33;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Water Creature");
                        break;

                    case "CONST_ME_GROUNDSHAKER":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z34;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Ground Shaker");
                        break;

                    case "CONST_ME_HEARTS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z35;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Heart");
                        break;

                    case "CONST_ME_FIREATTACK":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z36;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Fire Attack");
                        break;

                    case "CONST_ME_ENERGYAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z37;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Energy Area");
                        break;

                    case "CONST_ME_SMALLCLOUDS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z38;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Small Clouds");
                        break;

                    case "CONST_ME_HOLYDAMAGE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z39;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Holy Damage");
                        break;

                    case "CONST_ME_BIGCLOUDS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z40;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Big Clouds");
                        break;

                    case "CONST_ME_ICEAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z41;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Ice Area");
                        break;

                    case "CONST_ME_ICETORNADO":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z42;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Ice Tornado");
                        break;

                    case "CONST_ME_ICEATTACK":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z43;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Ice Attack");
                        break;

                    case "CONST_ME_STONES":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z44;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Stones");
                        break;

                    case "CONST_ME_SMALLPLANTS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z45;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Small Plants");
                        break;

                    case "CONST_ME_CARNIPHILA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z46;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Carniphila");
                        break;
                    // xd
                    case "CONST_ME_PURPLEENERGY":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z47;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Purple Energy");
                        break;

                    case "CONST_ME_YELLOWENERGY":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z48;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Yellow Energy");
                        break;

                    case "CONST_ME_HOLYAREA":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z49;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Holy Area");
                        break;

                    case "CONST_ME_BIGPLANTS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z50;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Big Plants");
                        break;

                    case "CONST_ME_CAKE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z51;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Cake");
                        break;

                    case "CONST_ME_GIANTICE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z52;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Giant Ice");
                        break;

                    case "CONST_ME_WATERSPLASH":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z53;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Whater Splash");
                        break;

                    case "CONST_ME_PLANTATTACK":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z54;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Plant Attack");
                        break;

                    case "CONST_ME_TUTORIALARROW":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z55;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Tutorial Arrow");
                        break;

                    case "CONST_ME_TUTORIALSQUARE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z56;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Tutorial Square");
                        break;

                    case "CONST_ME_MIRRORHORIZONTAL":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z57;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Mirror Horizontal");
                        break;

                    case "CONST_ME_MIRRORVERTICAL":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z58;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Mirror Vertical");
                        break;

                    case "CONST_ME_SKULLHORIZONTAL":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z59;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Skull Horizontal");
                        break;

                    case "CONST_ME_SKULLVERTICAL":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z60;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Skull Vertical");
                        break;

                    case "CONST_ME_ASSASSIN":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z61;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Assassin");
                        break;

                    case "CONST_ME_STEPSHORIZONTAL":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z62;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Steps Horizontal");
                        break;

                    case "CONST_ME_BLOODYSTEPS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z63;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Blood Steps");
                        break;

                    case "CONST_ME_STEPSVERTICAL":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z64;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Steps Vertical");
                        break;

                    case "CONST_ME_YALAHARIGHOST":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z65;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Yalaharia Ghost");
                        break;

                    case "CONST_ME_BATS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z66;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Bats");
                        break;

                    case "CONST_ME_SMOKE":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z67;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Smoke");
                        break;

                    case "CONST_ME_INSECTS":
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.z68;
                        InfoTooTip.SetToolTip(this.ImageEffect, "Effect Selected: Insect");
                        break;

                    default:
                        ImageEffect.Image = AngelSpellMaker.Properties.Resources.noimage;
                        break;
                }
            }
            catch (System.IO.FileNotFoundException)
            {
                MessageBox.Show("Image Not Found", "Internal Error");
            }
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string b = comboBox1.Text;
                switch (b)
                {
                    case "CONST_ANI_SPEAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x1;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Spear");
                        break;

                    case "CONST_ANI_BOLT":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x2;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Bolt");
                        break;

                    case "CONST_ANI_ARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x3;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Arrow");
                        break;

                     case "CONST_ANI_FIRE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x4;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Fire");
                        break;
						
					 case "CONST_ANI_ENERGY":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x5;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Energy");
                        break;

					 case "CONST_ANI_POISONARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x6;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Poison Arrow");
                        break;
						
					case "CONST_ANI_BURSTARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x7;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Burst Arrow");
                        break;
						
					case "CONST_ANI_THROWINGSTAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x8;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Throwing Star");
                        break;
						
					case "CONST_ANI_THROWINGKNIFE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x9;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Throwing Knife");
                        break;
						
					case "CONST_ANI_SMALLSTONE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x10;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Small Stone");
                        break;
						
					case "CONST_ANI_DEATH":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x11;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Death");
                        break;
						
					case "CONST_ANI_LARGEROCK":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x12;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Large Rock");
                        break;
						
					case "CONST_ANI_SNOWBALL":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x13;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Snow Ball");
                        break;
						
					case "CONST_ANI_POWERBOLT":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x14;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Power Bolt");
                        break;
						
					case "CONST_ANI_POISON":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x15;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Poison");
                        break;
						
					case "CONST_ANI_INFERNALBOLT":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x16;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Infernal Bolt");
                        break;
						
					case "CONST_ANI_HUNTINGSPEAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x17;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Hunting Spear");
                        break;
						
					case "CONST_ANI_ENCHANTEDSPEAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x18;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Enchanted Spear");
                        break;
						
					case "CONST_ANI_REDSTAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x19;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Red Star");
                        break;
						
					case "CONST_ANI_GREENSTAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x20;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Green Star");
                        break;
						
					case "CONST_ANI_ROYALSPEAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x21;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Royal Spear");
                        break;
						
					case "CONST_ANI_SNIPERARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x22;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Sniper Arrow");
                        break;
						
					case "CONST_ANI_ONYXARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x23;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Onyx Arrow");
                        break;
						
					case "CONST_ANI_PIERCINGBOLT":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x24;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Piercing Bolt");
                        break;
						
					case "CONST_ANI_WHIRLWINDSWORD":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x25;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Whirlwind Sword");
                        break;
						
					case "CONST_ANI_WHIRLWINDAXE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x26;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Whirlwind Axe");
                        break;
						
					case "CONST_ANI_WHIRLWINDCLUB":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x27;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Whirlwind Club");
                        break;
						
					case "CONST_ANI_ETHEREALSPEAR":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x28;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Ethereal Spear");
                        break;
						
					case "CONST_ANI_ICE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x29;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Ice");
                        break;
						
					case "CONST_ANI_EARTH":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x30;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Earth");
                        break;
						
					case "CONST_ANI_HOLY":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x31;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Holy");
                        break;
						
					case "CONST_ANI_SUDDENDEATH":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x32;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Sudden Death");
                        break;
						
					case "CONST_ANI_FLASHARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x33;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Flash Arrow");
                        break;
						
					case "CONST_ANI_FLAMMINGARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x34;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Flamming Arrow");
                        break;
						
					case "CONST_ANI_SHIVERARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x35;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Shive Arrow");
                        break;
						
					case "CONST_ANI_ENERGYBALL":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x36;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Energy Ball");
                        break;
						
					case "CONST_ANI_SMALLICE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x37;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Small Ice");
                        break;
						
					case "CONST_ANI_SMALLHOLY":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x38;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Small Holy");
                        break;
						
					case "CONST_ANI_SMALLEARTH":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x39;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Small Earth");
                        break;
						
					case "CONST_ANI_EARTHARROW":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x40;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Earth Arrow");
                        break;
						
					case "CONST_ANI_EXPLOSION":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x41;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Explosion");
                        break;
						
					case "CONST_ANI_CAKE":
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.x42;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect Selected: Cake");
                        break;

                    default:
                        ImageDistance.Image = AngelSpellMaker.Properties.Resources.noimage;
                        InfoTooTip.SetToolTip(this.ImageDistance, "Distance Effect preview image is selected");
                        break;
                }
            }
            catch (System.IO.FileNotFoundException)
            {
                MessageBox.Show("Image Not Found", "Internal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string c = comboBox2.Text;
                switch (c)
                {
                    case "COMBAT_NONE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.none;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: None");
                        break;

                    case "COMBAT_PHYSICALDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.physical;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Physical");
                        break;

                    case "COMBAT_ENERGYDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.energy;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Energy");
                        break;

                    case "COMBAT_EARTHDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.earth;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Earth");
                        break;

                    case "COMBAT_POISONDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.poison;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Poison");
                        break;

                    case "COMBAT_FIREDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.fire;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Fire");
                        break;

                    case "COMBAT_UNDEFINEDDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.cundefined;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Undefined");
                        break;

                    case "COMBAT_LIFEDRAIN":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.lifedrain;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Life Drain");
                        break;

                    case "COMBAT_MANADRAIN":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.manadrain;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Mana Drain");
                        break;

                    case "COMBAT_HEALING":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.heal;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Healing");
                        break;

                    case "COMBAT_DROWNDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.drown;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Drown");
                        break;

                    case "COMBAT_ICEDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.ice;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Ice");
                        break;

                    case "COMBAT_HOLYDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.holy;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Holy");
                        break;

                    case "COMBAT_DEATHDAMAGE":
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.death;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Damage Selected: Death");
                        break;

                    default:
                        ImageDamage.Image = AngelSpellMaker.Properties.Resources.noimage;
                        InfoTooTip.SetToolTip(this.ImageDamage, "Dont Have Information for this");
                        break;
                }
            }
            catch (System.IO.FileNotFoundException)
            {
                MessageBox.Show("Image Not Found", "Internal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        #endregion


        #region Vocations CheckBoxs
        private void CheckSorcerer_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckSorcerer.Checked == true)
            {
                voc1 = AngelSpellMaker.Properties.Resources.voc1;
            }
            else
            {
                voc1 = "";
            }
        }

        private void CheckDruid_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckDruid.Checked == true)
            {
                voc2 = AngelSpellMaker.Properties.Resources.voc2;
            }
            else
            {
                voc2 = "";
            }
        }

        private void CheckPaladin_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckPaladin.Checked == true)
            {
                voc3 = AngelSpellMaker.Properties.Resources.voc3;
            }
            else
            {
                voc3 = "";
            }
        }

        private void CheckKnight_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckKnight.Checked == true)
            {
                voc4 = AngelSpellMaker.Properties.Resources.voc4;
            }
            else
            {
                voc4 = "";
            }
        }
        #endregion       

    }
}
